<template>
  <div class="balance">
    <mt-header title="卿点好物">
      <router-link to="/user" slot="left">
        <mt-button icon="back"></mt-button>
      </router-link>
      <mt-button @click="ClickHandleHaowuAdd" slot="right">发布</mt-button>
    </mt-header>
    <div>
      <mt-cell
        v-for="(item, index) of list"
        :key="index"
        class="border-bottom"
        :title="item.name"
        :label=" '(' + item.status + ')'"
        :to="'/user-haowuItem/' + item.id"
        is-link
        :value="item.status">
        <img :src="item.img" width="120" alt="">
      </mt-cell>
    </div>
  </div>
</template>

<script>
// import { MessageBox, Toast } from 'mint-ui'
import axios from 'axios'
export default {
  name: 'Haowu',
  data () {
    return {
      list: []
    }
  },
  methods: {
    ClickHandleHaowuAdd () {
      this.$router.push('/user-haowuAdd')
    },
    getInfo () {
      axios.get('/meimai/interface/goodsUsed/personalList', {
        params: {
          memberId: this.$store.state.userId
        }
      }).then((res) => {
        let datas = res.data
        if (datas.code === 0) {
          this.list = datas.array
        }
        console.log(res)
      })
    }
  },
  mounted () {
    this.getInfo()
  }
}
</script>

<style lang="stylus" scoped>
@import '~styles/mixins.styl'
@import '~styles/varibles.styl'
.mint-header
  background: $colorRed
.mint-cell
  padding: .1rem 0
</style>
